//////Adilet Joldoshbekov
////// 2 - grade
////// 1204.01012 
using System;
using Microsoft.Win32;


class MyClass
{
    private static void Main()
    {
        long d = 1, r, a;
        char ch;
        string str,temp="";
        Console.WriteLine("Enter a number for to convert  16 digit : ");
        a = Convert.ToInt64(Console.ReadLine());
        while (d != 0)
        {
            r = a%16;
            d = a/16;
            a = d;


            str = r.ToString();
           // Console.WriteLine("str: {0}",str );
            if (r == 10)
            {
                ch = 'A';
                str = ch.ToString();
                temp = str + temp;
            }
          else if (r == 11)
          {
              ch = 'B';
              str = ch.ToString();
              temp = str + temp;
          }
          else if (r == 12)
          {
              ch = 'C';
              str = ch.ToString();
              temp = str + temp;
          }
          else if (r == 13)
          {
              ch = 'D';
              str = ch.ToString();
              temp = str + temp;
          }
          else if (r == 14)
          {
              ch = 'E';
              str = ch.ToString();
              temp = str + temp;
          }
          else if (r == 15)
          {
              ch = 'F';
              str = ch.ToString();
              temp = str + temp;
          }
          else
          {
              str = r.ToString();
              temp = str + temp;
          }

            //  Console.WriteLine(r);
          


        }
        Console.WriteLine("Converted: {0}",temp);
        Console.ReadKey();

    }
}